package com.xyb.dao;

import com.xyb.entity.Chapter;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * 课程章节(Chapter)表数据库访问层
 *
 * @author makejava
 * @since 2021-11-10 16:43:00
 */
public interface ChapterRepository extends JpaRepository<Chapter, Long> {

    List<Chapter> findByCourseIdAndStatus(Long courseId, Integer status);

    List<Chapter> findByCourseIdAndStatusOrderByShowOrder(Long courseId, Integer status);

    Integer countByCourseId(Long courseId);
}